'use strict'
class userpage{
    constructor(){

    }
    async list(c){
        let wuser = c.service.model.user
        let ulist = await wuser.get(c.query.userid)
        c.send(ulist)
    }

    //修改数据
    async put(c){
        let id=c.param.id
        let data= JSON.parse(c.body)
        console.log(data)
        let wuser =c.service.model.user
        await wuser.update(data,id)
    }

    //插入数据
    async post(c){
        let data= JSON.parse(c.body)
        let result = c.service.model.user
        await result.insert(data)
    }
}
module.exports=userpage